window.onload = function (){
    getUser();
}

function getUser(){



    axios.get("/user/getLoginUser").then(resp =>{
        var info = resp.data;
        console.log(info)
        if (info === "noland"){
            location.href="/login.html?errorInfo=noland";
        }else {

            $("stuWeb").href="/html/stuManage.html?id="+info.id;
            $("classWeb").href="/html/classManage.html?id="+info.id;
            $("roomWeb").href="/html/roomInfo.html?id="+info.id;
            $("userWeb").href="/html/userManage.html?id="+info.id;
            $("pwdWeb").href="/html/changePwd.html?id="+info.id;
            if (info.level == "班主任"){
                $("roomWeb").href="accessLimit.html";
                $("userWeb").href="accessLimit.html";
            }
            if (info.level == "房间管理员"){
                $("stuWeb").href="accessLimit.html";
                $("classWeb").href="accessLimit.html";
                $("userWeb").href="accessLimit.html";
            }
            if (info.level == "系统管理员"){
                $("stuWeb").href="accessLimit.html";
                $("classWeb").href="accessLimit.html";
                $("roomWeb").href="accessLimit.html";
            }


        }




    })
}